//
//  MainVC_Mine_CompanyCard.m
//  liBaQiang
//
//  Created by 奇林刘 on 2018/10/11.
//  Copyright © 2018年 liu. All rights reserved.
//

#import "MainVC_Mine_CompanyCard.h"

@interface MainVC_Mine_CompanyCard ()

@property (nonatomic, strong) UIImageView *headImageView;
@property (nonatomic, strong) UILabel *userNameLabel;
@property (nonatomic, strong) UIImageView *rightImageView;
@property (nonatomic, strong) UIView *lineView;
@property (nonatomic, strong) UILabel *companyNameLabel;
@property (nonatomic, strong) UILabel *authStateLabel;

@end

@implementation MainVC_Mine_CompanyCard

#pragma mark - lifeCycle
- (void)configSelf {
    [self mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(@(RPX(355)));
        make.height.equalTo(@(RPX(150)));
    }];
    self.fp_shadowColor(HexadecimalColor(@"#0084FF"))
        .fp_backgroundColor(HexadecimalColor(@"#FFFFFF"))
        .fp_shadowOffset(CGSizeMake(0, RPX(3)))
        .fp_shadowRadius(RPX(4))
        .fp_shadowOpacity(0.08)
        .fp_cornerRadius(RPX(4));
}

- (void)allocateComponents {
    [self allocateHeadImageView];
    [self allocateUserNameLabel];
    [self allocateRightImageView];
    [self allocateLineView];
    [self allocateCompanyNameLabel];
    [self allocateAuthStateLabel];
}

- (void)configComponents {
    [self configHeadImageView];
    [self configUserNameLabel];
    [self configRightImageView];
    [self configLineView];
    [self configCompanyNameLabel];
    [self configAuthStateLabel];
}

#pragma mark - usedMethods
- (void)allocateHeadImageView {
    self.fp_addSubview(self.headImageView=[[UIImageView alloc]init]);
    [self.headImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.self.offset(RPX(25));
        make.left.equalTo(self).offset(RPX(15));
        make.width.height.equalTo(@(RPX(50)));
    }];
}

- (void)allocateUserNameLabel {
    self.fp_addSubview(self.userNameLabel=[[UILabel alloc]init]);
    [self.userNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.headImageView.mas_right).offset(RPX(16));
        make.centerY.equalTo(self.headImageView);
    }];
}

- (void)allocateRightImageView {
    self.fp_addSubview(self.rightImageView=[[UIImageView alloc]init]);
    [self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.headImageView);
        make.right.equalTo(self).offset(RPX(-15));
        make.width.height.equalTo(@(RPX(20)));
    }];
}

- (void)allocateLineView {
    self.fp_addSubview(self.lineView=[[UIView alloc]init]);
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self).offset(RPX(100));
        make.width.equalTo(@(RPX(325)));
        make.height.equalTo(@(RPX(1)));
    }];
}

- (void)allocateCompanyNameLabel {
    self.fp_addSubview(self.companyNameLabel=[[UILabel alloc]init]);
    [self.companyNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(RPX(17));
        make.bottom.equalTo(self).offset(RPX(-18));
    }];
}

- (void)allocateAuthStateLabel {
    self.fp_addSubview(self.authStateLabel=[[UILabel alloc]init]);
    [self.authStateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.companyNameLabel);
        make.right.equalTo(self).offset(RPX(-15));
    }];
}

- (void)configHeadImageView {
    [self.headImageView setImage:[UIImage imageNamed:@"index_banner"]];
    self.headImageView.fp_contentMode(UIViewContentModeScaleAspectFill)
        .fp_cornerRadius(RPX(25))
        .fp_clipsToBounds(YES);
}

- (void)configUserNameLabel {
    self.userNameLabel.fp_font(RPXFont(15))
        .fp_text(@"HelloWorld");
}

- (void)configRightImageView {
    [self.rightImageView setImage:[UIImage imageNamed:@"index_banner"]];
    self.rightImageView.fp_contentMode(UIViewContentModeScaleAspectFill)
        .fp_clipsToBounds(YES);
}

- (void)configLineView {
    self.lineView.fp_backgroundColor(HexadecimalColor(@"#EBEBEB"));
}

- (void)configCompanyNameLabel {
    self.companyNameLabel.fp_font(RPXFont(14))
        .fp_text(@"北拓科技网络有限公司");
}

- (void)configAuthStateLabel {
    self.authStateLabel.fp_font(RPXFont(13))
        .fp_textColor(HexadecimalColor(@"#B3B3B3"))
        .fp_text(@"未认证");
}


@end
